<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"><title>Apache JMeter
          -
          User's Manual: Building an LDAP Test Plan</title><meta name="viewport" content="width=device-width, initial-scale=1"><link href="http://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"><link rel="stylesheet" type="text/css" href="../css/new-style.css"></head><body role="document"><a href="#content" class="hidden">Main content</a><div class="header"><!--
            APACHE LOGO
          --><div><a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" alt="Logo ASF"></a></div><!--
              PROJECT LOGO
            --><div><a href="http://jmeter.apache.org/"><img src="../images/logo.jpg" alt="Apache JMeter"></a></div><div class="twitter"><div><a href="https://twitter.com/share" class="twitter-share-button" data-text="Powerful Load Testing with Apache #JMeter" data-via="ApacheJMeter" data-lang="en-gb" data-size="large">Tweet</a><script>
            (function(d,s,id){
              var js,
                  fjs=d.getElementsByTagName(s)[0],
                  p=/^http:/.test(d.location)?'http':'https';
              if (!d.getElementById(id)) {
                  js=d.createElement(s);
                  js.id=id;
                  js.src=p+'://platform.twitter.com/widgets.js';
                  fjs.parentNode.insertBefore(js,fjs);
              }
            })(document, 'script', 'twitter-wjs');
              </script></div><div><a href="https://twitter.com/ApacheJMeter" class="twitter-follow-button" data-show-count="false" data-lang="en-gb" data-size="large">Follow</a><script>(function(d,s,id){
                var js,
                    fjs=d.getElementsByTagName(s)[0],
                    p=/^http:/.test(d.location)?'http':'https';
                if (!d.getElementById(id)) {
                    js=d.createElement(s);
                    js.id=id;
                    js.src=p+'://platform.twitter.com/widgets.js';
                    fjs.parentNode.insertBefore(js,fjs);
                }
            })(document, 'script', 'twitter-wjs');
              </script></div></div><div class="banner"><iframe src="http://www.apache.org/ads/bannerbar.html" style="border-width:0;" frameborder="0" scrolling="no"></iframe><div class="clear"></div></div></div><div class="nav"><ul class="menu"><li><div class="menu-title">About</div><ul><li><a href="../index.html">Overview</a></li><li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter<img src="../images/twitter.png" alt="Icon for JMeter on Twitter"></a></li><li><a href="../issues.html">Issue Tracking</a></li><li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a></li><li><a href="http://www.apache.org/licenses/">License</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Download</div><ul><li><a href="../download_jmeter.cgi">Download Releases</a></li><li><a href="../nightly.html">Developer (Nightly) Builds</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Documentation</div><ul><li><a href="../changes.html">Changes per version</a></li><li><a href="../usermanual/get-started.html">Get Started</a></li><li><a href="../usermanual/index.html">User Manual</a></li><li><a href="../usermanual/best-practices.html">Best Practices</a></li><li><a href="../usermanual/component_reference.html">Component Reference</a></li><li><a href="../usermanual/functions.html">Functions Reference</a></li><li><a href="../api/index.html">Javadocs</a></li><li><a href="../building.html">Building JMeter and Add-Ons</a></li><li><a href="http://wiki.apache.org/jmeter">JMeter Wiki</a></li><li><a href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ (Wiki)</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Tutorials (PDF format)</div><ul><li><a href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed Testing</a></li><li><a href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording Tests</a></li><li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit Sampler</a></li><li><a href="../usermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a></li><li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Community</div><ul><li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a></li><li><a href="../mail.html">Mailing Lists</a></li><li><a href="../svnindex.html">SVN Repositories</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Foundation</div><ul><li><a href="http://www.apache.org/">ASF</a></li><li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a></li><li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li></ul></li></ul></div><div class="main" id="content"><ul class="pagelinks"><li><a href="build-ftp-test-plan.html">&lt; Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-ldapext-test-plan.html">Next &gt;</a></li></ul><div class="section"><h1 id="building">9a. Building an LDAP Test Plan<a class="sectionlink" href="#building" title="Link to here">&para;</a></h1>
        <p>In this section, you will learn how to create a basic Test Plan to test an LDAP server.
You will create four users that send requests for four tests on the LDAP server. Also, you will tell
the users to run their tests 4 times. So,  the total number of requests is (4 users) x (4 requests) x
repeat 4 times) = 40 LDAP requests. To construct the Test Plan, you will use the following elements:
<a href="test_plan.html#thread_group">Thread Group</a>,
<a href="../usermanual/component_reference.html#LDAP_Request">LDAP Request</a>,
<a href="../usermanual/component_reference.html#LDAP_Request_Defaults">LDAP Request Defaults</a>, and
<a href="../usermanual/component_reference.html#View_Results_in_Table">View Results in Table</a>
.</p>
        <p>This example assumes that the LDAP Server is available at ldap.test.com.</p>
</div><div class="section"><h1 id="adding_users">9a.1 Adding Users<a class="sectionlink" href="#adding_users" title="Link to here">&para;</a></h1>
        <p>The first step you want to do with every JMeter Test Plan is to add a Thread Group element.
The Thread Group tells JMeter the number of users you want to simulate, how often the users should send
requests, and the how many requests  they should send.</p>
                <p>Go ahead and add the ThreadGroup element by first selecting the Test Plan, clicking your
right mouse button to get the <b>Add</b> menu, and then select <b>Add</b>&gt;<b>ThreadGroup</b>. You should now see the
Thread Group element under Test Plan. If you do not see the element, then "expand" the Test Plan tree by
clicking on the Test Plan element.
<figure><a href="../images/screenshots/ldaptest/threadgroup.png"><img src="../images/screenshots/ldaptest/threadgroup.png" width="" height="" alt="
Figure 9a.1. Thread Group and final test tree"></a><figcaption>
Figure 9a.1. Thread Group and final test tree</figcaption></figure>

</p>
</div><div class="section"><h1 id="add_login">9a.2 Adding Login Config Element<a class="sectionlink" href="#add_login" title="Link to here">&para;</a></h1>
        <p>Begin by selecting the <b>LDAP Users</b> element. Click your right mouse
button to get the Add menu, and then select <b>Add</b>&gt;<b>Config Element</b>&gt;<b>Login Config Element</b>.
Then,  select this new element to view its Control Panel.</p>
        <p>Like most JMeter elements, the <b>Login  Config Element</b>'s Control Panel has a name
field that you can modify. In this example, leave this field with the default value.</p>

<figure><a href="../images/screenshots/ldaptest/login-config-element.png"><img src="../images/screenshots/ldaptest/login-config-element.png" width="" height="" alt="
  Figure 9a.2 Login Config Element for our Test Plan"></a><figcaption>
  Figure 9a.2 Login Config Element for our Test Plan</figcaption></figure>

        <div class="clear"></div><div class="note"><p>Enter Username field to "your LDAP Username",<br>
        The password field to "your LDAP Passowrd"</p>

        <p>These values will be used by the LDAP Requests.</p></div><div class="clear"></div>
</div><div class="section"><h1 id="add_defaults">9a.3 Adding LDAP Request Defaults<a class="sectionlink" href="#add_defaults" title="Link to here">&para;</a></h1>
                <p>Begin by selecting the LDAP Users element. Click your right mouse button
to get the <b>Add</b> menu, and then select <b>Add</b>&gt;<b>Config Element</b>&gt;<b>LDAP Request Defaults</b>. Then,
select this new element to view its Control Panel.</p>
        <p>Like most JMeter elements, the <b>LDAP Request Defaults</b> Control Panel has a name
field that you can modify. In this example, leave this field with the default value.</p>


<figure><a href="../images/screenshots/ldaptest/requestdefaults.png"><img src="../images/screenshots/ldaptest/requestdefaults.png" width="" height="" alt="
  Figure 9a.3 LDAP Defaults for our Test Plan"></a><figcaption>
  Figure 9a.3 LDAP Defaults for our Test Plan</figcaption></figure>

        <div class="clear"></div><div class="note">Enter DN field to "your LDAP Root Distinguished Name".<br>
                Enter LDAP Server's Servername field to "ldap.test.com".<br>
        The port to 389.<br>
        These values are default for the LDAP Requests.</div><div class="clear"></div>
</div><div class="section"><h1 id="add_requests">9a.4 Adding LDAP Requests<a class="sectionlink" href="#add_requests" title="Link to here">&para;</a></h1>
                <p>In our Test Plan, we need to make four LDAP requests.</p>
                <ol>
            <li>Inbuilt Add Test</li>
            <li>Inbuilt Search Test</li>
            <li>Inbuilt Modify Test</li>
            <li>Inbuilt Delete Test</li>

        </ol>
        <p>JMeter sends requests in the order that you add them to the tree.
Start by adding the first LDAP Request to the LDAP Users element (<b>Add</b>&gt;<b>
Sampler</b>&gt;<b>LDAP Request</b>). Then, select the LDAP Request  element in the tree
and edit the following properties</p>
        <ol>
            <li>Rename to "Add" this element</li>
            <li>Select the <b>Add Test</b> radio button in <b>Test Configuration</b> group</li>
        </ol>
                <figure><a href="../images/screenshots/ldaptest/add.png"><img src="../images/screenshots/ldaptest/add.png" width="" height="" alt="
                  Figure 9a.4.1 LDAP Request for Inbuilt Add test"></a><figcaption>
                  Figure 9a.4.1 LDAP Request for Inbuilt Add test</figcaption></figure>


                <p>You do not have to set the Server Name field, port field, Username, Password
and DN because you already specified this value in the <b>Login Config Element</b> and
<b>LDAP Request Defaults.</b></p>
        <p>Next, add the second LDAP Request and edit the following
properties</p>
        <ol>
            <li>Rename to "Search" this element</li>
            <li>Select the <b>Search Test</b> radio button in <b>Test Configuration</b> group</li>
        </ol>
        Next, add the Third LDAP Request and edit the following properties
                <figure><a href="../images/screenshots/ldaptest/search.png"><img src="../images/screenshots/ldaptest/search.png" width="" height="" alt="
                  Figure 9a.4.2 LDAP Request for Inbuilt Search test"></a><figcaption>
                  Figure 9a.4.2 LDAP Request for Inbuilt Search test</figcaption></figure>

        <ol>
            <li>Rename to "Modify" this element</li>
            <li>Select the <b>Modify Test</b> radio button in <b>Test Configuration</b> group</li>
        </ol>
        Next, add the fourth LDAP Request and edit the following properties
                
                <figure><a href="../images/screenshots/ldaptest/modify.png"><img src="../images/screenshots/ldaptest/modify.png" width="" height="" alt="
                  Figure 9a.4.3 LDAP Request for Inbuilt Modify test"></a><figcaption>
                  Figure 9a.4.3 LDAP Request for Inbuilt Modify test</figcaption></figure>

        <ol>
            <li>Rename to "Delete" this element</li>
            <li>Select the <b>Delete Test</b> radio button in <b>Test Configuration</b> group</li>
        </ol>
                <figure><a href="../images/screenshots/ldaptest/delete.png"><img src="../images/screenshots/ldaptest/delete.png" width="" height="" alt="
                  Figure 9a.4.4 LDAP Request for Inbuilt Delete test"></a><figcaption>
                  Figure 9a.4.4 LDAP Request for Inbuilt Delete test</figcaption></figure>

</div><div class="section"><h1 id="ResponseAssertion">9a.5 Adding a Response Assertion<a class="sectionlink" href="#ResponseAssertion" title="Link to here">&para;</a></h1>
               <p>You can add a Response Assertion element.
 This element will check the received response data by verifying if the response text is "successful".
  (<b>Add</b>&gt;<b>Assertion</b>&gt;<b>Response Assertion</b>).<br>Note: A this position in the tree,
  the Response Assertion will be executed for each LDAP Request.</p>
          <ol>
            <li>Select <b>Text Response</b> Radio button in <b>Response Field to Test</b> group</li>
            <li>Select <b>Substring</b> Radio button in <b>Pattern Matching Rules</b> group</li>
            <li>Click on <b>Add</b> button and add the string "successful" in <b>Pattern to Test</b> field</li>
        </ol>
<figure><a href="../images/screenshots/ldaptest/responseassertion.png"><img src="../images/screenshots/ldaptest/responseassertion.png" width="" height="" alt="
  Figure 9a.5 LDAP Response Assertion"></a><figcaption>
  Figure 9a.5 LDAP Response Assertion</figcaption></figure>
</div><div class="section"><h1 id="add_listener">9a.6 Adding a Listener to View/Store the Test Results<a class="sectionlink" href="#add_listener" title="Link to here">&para;</a></h1>
               <p>The final element you need to add to your Test Plan is a Listener.
 This element is responsible for storing all of the results of your LDAP
requests in a file  and presenting a visual model of the data. Select the LDAP
Users element and add a View Results in Table (<b>Add</b>&gt;<b>Listener</b>&gt;<b>View Results in Table</b>)</p>
<figure><a href="../images/screenshots/ldaptest/viewtable.png"><img src="../images/screenshots/ldaptest/viewtable.png" width="" height="" alt="
  Figure 9a.6 View Results in Table Listener"></a><figcaption>
  Figure 9a.6 View Results in Table Listener</figcaption></figure>

</div><ul class="pagelinks"><li><a href="build-ftp-test-plan.html">&lt; Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-ldapext-test-plan.html">Next &gt;</a></li></ul></div><div class="footer"><div class="copyright">
            Copyright &copy;
            1999 &ndash;
            2015
            , Apache Software Foundation
          </div><div class="trademarks">Apache, Apache JMeter, JMeter, the Apache
            feather, and the Apache JMeter logo are
            trademarks of the
            Apache Software Foundation.
          </div></div></body></html>